home *** CD-ROM | disk | FTP | other *** search
- /* XPrinter.h
- *
- * This is the interface for printing. This handles a standard
- * printing interface for both Windows and MacOS
- */
-
- /* YAAF - Yet another application framework
- * Copyright (C) 1997 William Edward Woody and In Phase Consulting
- *
- * This library is free software; you can redistribute it
- * and/or modify it under the terms of the GNU Library
- * General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or any
- * later version.
- *
- * This library is distributed in the hope that it will be
- * useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABIILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU Library General Public License for
- * more details.
- *
- * You should have received a copy of the GNU Library General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * To contact the author, either e-mail me at
- * woody@alumni.caltech.edu, or write to us at
- *
- * William Edward Woody
- * In Phase Consulting
- * 1545 Ard Eevin Avenue
- * Glendale, CA 91202
- */
-
- #ifndef __XPRINTER_H__
- #define __XPRINTER_H__
-
- #include <XView.h>
-
- #if defined(__MWERKS__)
- #if defined(macintosh)
- #pragma options align=power
- #endif
- #if defined(__INTEL__)
- #pragma pack(push,2)
- #endif
- #endif
-
- /************************************************************************/
- /* */
- /* Constants */
- /* */
- /************************************************************************/
-
- #define KTPDefault 0x8000
- #define KTPSquareResolution 0x0001
- #define KTPMaxResolution 0x0002
-
- /************************************************************************/
- /* */
- /* Default menu commands */
- /* */
- /************************************************************************/
-
- /* XGPrinter
- *
- * This is a printer interface. And no, we can only have one of
- * these at a time.
- */
-
- class XGPrinter {
- public:
- XGPrinter();
- virtual ~XGPrinter();
-
- /*
- * Current Page size settings
- */
-
- Rect PageSize(); // size of a page
- Rect PrintSize(); // printing area in page
- Point Resolution(); // Resolution of page
-
- /*
- * Set the resolution
- */
-
- void SetResolution(short);
-
- /*
- * Run the dialog boxes
- */
-
- bool PageSetup();
- bool PrintJob(short *, short *);
-
- /*
- * Printing core
- */
-
- bool StartJob(char *docname = NULL);
- void EndJob();
- bool StartPage();
- void EndPage();
- bool GetCancelState();
-
- private:
-
- #if OPT_MACOS == 1
- void OpenWindow(void);
-
- bool fPrinter;
- THPrint fHPrint;
- TPPrPort fPort;
- WindowPtr fWindow;
- #endif
-
- #if OPT_WINOS == 1
- HDC fPrintDC;
- PRINTDLG fPrintData;
- #endif
-
- friend class XGDraw;
- };
-
- /************************************************************************/
- /* */
- /* Globals */
- /* */
- /************************************************************************/
-
- extern XGPrinter GPrinter; /* The printer interface */
-
-
- #if defined(__MWERKS__)
- #if defined(macintosh)
- #pragma options align=reset
- #endif
- #if defined(__INTEL__)
- #pragma pack(pop)
- #endif
- #endif
-
- #endif
-